
<script>
		var total = {$totalPrice|string_format:"%.2f"};
		var adapterButtons = '';
		{foreach $matrices as $p}
			{if $p@first}
        		currentDeviceMatricesId = {$p.id};
        	{/if}
        	 adapterButtons = adapterButtons + '<span class="sks_button" onclick="setCurrentDeviceMatricesId({$p.id});">Edit {$p.name}</span>';
        {/foreach}
        
        {literal}

		$(document).ready(function() { 
			//alert(adapterButtons);
       		$('#adapterButtons').html(adapterButtons);
		});
		
		
		function updateTotal(obj, price){
			
			if (obj.checked == true){
				total = total+price;
				$('#dpb_total_price').html('&euro; ' + total.toFixed(2));
				//alert('is checked -> set total = ' + total);
			} else {
				total = total - price;
				$('#dpb_total_price').html('&euro; ' + total.toFixed(2));
				//alert('is unchecked -> set total = ' + total);
			}
			
		}
		{/literal}
        loadAdapter();
</script>

<div id="dpb_artwork">
    <div id="dpb_artwork_title">PRICE OF THIS ARTWORK</div>
    <div id="dpb_courtsey">{$artworkCourtsey}</div>
    <div id="dpb_artwork_price">&#8364; {$artworkPrice|string_format:"%.2f"}</div>
</div>
<div id="dpb_plus">+</div>
<div id="dpb_production">
    <div id="dpb_production_title">SKIN PRODUCTION</div>
    {*<div id="dpb_production_price">{$productionPrice|string_format:"%.2f"}</div>*}
	<div id="dpb_production_price" style="font-size: 8pt;wrap: nowrap; width: 100px; text-align: left;">
		
		{assign var=totalP value=$artworkPrice}
		{foreach $matrices as $p}
			{assign var=totalP value=($totalP+$p.price)}
        	 <input type="checkbox" class="pointer priceBox" name="matrices[]" value="{$p.id};{$p.name};{$p.price}" checked onclick="updateTotal(this, {$p.price});"><i>{$p.name}</i>&nbsp;&euro;&nbsp;{$p.price|string_format:"%.2f"}<br />
        {/foreach}
	</div>
</div>
<script> total = {$totalP};</script>
<div id="dpb_equals">=</div>
<div id="dpb_total" style="width: 80px;">
    <div id="dpb_total_title">TOTAL</div>
    <div id="dpb_total_price">&euro; {$totalP|string_format:"%.2f"}</div>
</div>
<script>//alert(currentDeviceMatricesId);</script>